RPExtraTeams = {}
function AddExtraTeam( Name, color, model, Description, Weapons, command, maximum_amount_of_this_class, Salary, admin, Vote, Haslicense, NeedToChangeFrom)
	if not Name or not color or not model or not Description or not Weapons or not command or not maximum_amount_of_this_class or not Salary or not admin or Vote == nil then
		local text = "One of the custom teams is wrongly made! Attempt to give name of the wrongly made team!(if it's nil then I failed):\n" .. tostring(Name)
		print(text)
		hook.Add("PlayerSpawn", "TeamError", function(ply)
			if ply:IsAdmin() then ply:ChatPrint("WARNING: "..text) end
		end)	
	end
	local CustomTeam = {name = Name, model = model, Des = Description, Weapons = Weapons, command = command, max = maximum_amount_of_this_class, salary = Salary, admin = admin or 0, Vote = tobool(Vote), NeedToChangeFrom = NeedToChangeFrom, Haslicense = Haslicense}
	table.insert(RPExtraTeams, CustomTeam)
	team.SetUp(#RPExtraTeams, Name, color)
	local Team = #RPExtraTeams
	if SERVER then
		timer.Simple(0.1, function(CustomTeam) AddTeamCommands(CustomTeam) end, CustomTeam)
	end
	return Team
end

hook.Add("InitPostEntity", "AddTeams", function()
	if file.Exists("CustomTeams.txt") then
		RunString(file.Read("CustomTeams.txt"))
		if SERVER then resource.AddFile("data/CustomTeams.txt") end
		if CLIENT and not LocalPlayer():IsSuperAdmin() then file.Delete("CustomTeams.txt") end
	end
end)

/*--------------------------------------------------------
Default teams. If you make a team above the citizen team, people will spawn with that team!
--------------------------------------------------------*/
TEAM_CITIZEN = AddExtraTeam("Wastelander", Color(20, 150, 20, 255), "models/player/group01/male_01.mdl", [[The Citizen is the most basic level of society you can hold
besides being a hobo. 
You have no specific role in city life.]], {}, "wastelander", 0, 14, 0, false, false)
TEAM_GUN = AddExtraTeam("Gun Dealer", Color(255, 140, 0, 255), "models/player/monk.mdl", [[You are the most important person in this game, you sell guns.
Dont get caught Double Dealing!
/Buyshipment <name> to Buy a  weapon shipment
/Buygunlab to Buy a gunlab that spawns P228 pistols]], {}, "gundealer", 2, 45, 0, false, false)

/*
--------------------------------------------------------
HOW TO MAKE AN EXTRA CLASS!!!!
--------------------------------------------------------

You can make extra classes here. Set everything up here and the rest will be done for you! no more editing 100 files without knowing what you're doing!!!
Ok here's how:

To make an extra class do this:
AddExtraTeam( "<NAME OF THE CLASS>", Color(<red>, <Green>, <blue>, 255), "<Player model>" , [[<the description(it can have enters)>]], { "<first extra weapon>","<second extra weapon>", etc...}, "<chat command to become it(WITHOUT THE /!)>", <maximum amount of this team> <the salary he gets>, 0/1/2 = public /admin only / superadmin only, <1/0/true/false Do you have to vote to become it>,  true/false DOES THIS TEAM HAVE A GUN LICENSE?, TEAM: Which team you need to be to become this team)

The real example is here: it's the Hobo:		*/

--VAR without /!!!			The name    the color(what you see in tab)                   the player model					The description
//No extra weapons           say /hobo to become hobo  Maximum hobo's = 5		his salary = 0 because hobo's don't earn money.          0 = everyone can become hobo ,      false = you don't have to vote to become hobo
// MAKE SURE THAT THERE IS NO / IN THE TEAM NAME OR IN THE TEAM COMMAND:
// TEAM_/DUDE IS WROOOOOONG !!!!!!
// HAVING "/dude" IN THE COMMAND FIELD IS WROOOOOOOONG!!!!
//ADD TEAMS UNDER THIS LINE:
TEAM_MOD = AddExtraTeam("Merchant of Death", Color(139, 131, 120, 255), "models/player/combine_soldier.mdl", [[A MOD walks across 
a lone country side, with his finger on the trigger.]], {"weapon_crowbar"}, "mod", 20, 25, 0, false, true)
TEAM_MODINFANTRY = AddExtraTeam("M.O.D. Infantry", Color(139, 131, 120, 255), "models/player/combine_soldier.mdl", [[The Primary Fighting for the merchants of death!  
This is the backbone of your army dont let them down!]], {"kermite_smg_mp4", "kermite_pist_ot33pemac"}, "modinfantry", 8, 35, 0, false, true, TEAM_MOD)
TEAM_MODSHOT = AddExtraTeam("M.O.D. Shotgun", Color(150, 131, 120, 255), "models/player/combine_soldier.mdl", [[One of the Primary Fighting for the merchants of death!  
These are the Close range fighters for everyone.]], {"kermite_shot_remmin870", "kermite_pist_ot33pemac"}, "modshot", 2, 40, 0, true, true, TEAM_MOD)
TEAM_MODCOMMAND = AddExtraTeam("M.O.D. Commander", Color(150, 131, 120, 255), "models/player/combine_soldier.mdl", 
[[The Merchant of Death Commander]], {"kermite_pist_ot33pemac"}, "modcommand", 1, 45, 0, true, true, TEAM_MOD2CMD)
TEAM_MODCMD = AddExtraTeam("M.O.D. Commander", Color(150, 131, 120, 255), "models/player/combine_soldier.mdl", 
[[The Merchant of Death Commander]], {"kermite_pist_ot33pemac"}, "modcommand", 1, 40, 0, true, true, TEAM_MOD)
TEAM_MODDELEGATE = AddExtraTeam("Merchant of Death Delegate", Color(139, 131, 120, 255), "models/player/combine_soldier.mdl", [[A delegate talks 
with the enemy to work out trades, land claims, ect.]], {"weapon_crowbar"}, "modd", 3, 29, 0, false, true, TEAM_MOD)
TEAM_MODRECON = AddExtraTeam("M.O.D Recon", Color(150, 131, 120, 255), "models/player/combine_soldier.mdl", 
[[Scouts the plains ahead ]], {"kermite_pist_ot33pemac", "kermite_smg_mp9"}, "modrecon" , 1, 40, 0, false, true, TEAM_MOD)
TEAM_UMLF = AddExtraTeam("United Melon Liberation Front", Color(106, 90, 205, 255), "models/player/group03/male_09.mdl", [[With a pump of a 12 gauge, 
the UMLF is ready.]], {"weapon_crowbar"}, "umlf", 20, 25, 0, false, true)
TEAM_UMLFINFANTRY = AddExtraTeam("U.M.L.F. Infantry", Color(106, 90, 205, 255), "models/player/group03/male_09.mdl", [[The Primary Fighting for the united melon liberation front!  
This is the backbone of your army dont let them down!]], {"kermite_smg_c79", "kermite_pist_p99"}, "umlfinfantry", 8, 35, 0, false, true, TEAM_UMLF)
TEAM_UMLFSHOT = AddExtraTeam("M.O.D. Shotgun", Color(106, 90, 205, 255), "models/player/group03/male_09.mdl", [[One of the Primary Fighting for the united melon liberation front!  
These are the Close range fighters for everyone.]], {"kermite_shot_mossberg5", "kermite_pist_p99"}, "umlfshot", 2, 45, 0, true, true, TEAM_UMLF)
TEAM_UMLFCOMMAND = AddExtraTeam("U.M.L.F. Commander", Color(106, 90, 205, 255), "models/player/group03/male_09.mdl", 
[[The UMLF Commander]], {"kermite_pist_p99"}, "umlfcommand", 1, 45, 0, true, true, TEAM_UMLF2CMD)
TEAM_UMLFCMD = AddExtraTeam("U.M.L.F. Commander", Color(106, 90, 205, 255), "models/player/group03/male_09.mdl", 
[[The UMLF Commander]], {"kermite_pist_p99"}, "umlfcommander", 8, 40, 0, false, true, TEAM_UMLF)
TEAM_UMLFDELEGATE = AddExtraTeam("U.M.L.F. Delegate", Color(106, 90, 205, 255), "models/player/group03/male_09.mdl", 
[[A delegate talks with the enemy to work out trades, land claims, ect.]], {"weapon_crowbar"}, "umlfd", 20, 29, 0, false, true, TEAM_UMLF)
TEAM_UMLFRECON = AddExtraTeam("U.M.L.F Recon", Color(106, 90, 205, 255), "models/player/group03/male_09.mdl", 
[[Scouts the plains ahead ]], {"kermite_pist_p99", "kermite_smg_mp9"}, "umlfrecon" , 1, 40, 0, false, true, TEAM_UMLF)
TEAM_SBGF = AddExtraTeam("Supreme Banana Guerilla Force", Color(0, 0, 255, 255), "models/player/guerilla.mdl", 
[[The Expert in Guerilla Tactics and Warfare.]], {"weapon_crowbar"}, "SBGF", 20, 25, 0, false, true)
TEAM_SBGFINFANTRY = AddExtraTeam("S.B.G.F Infantry", Color(255, 140, 0, 255), "models/player/guerilla.mdl", 
[[The Bulk of militia forces, 
This is the backbone of your army dont let them down!]], {"kermite_smg_aks", "kermite_pist_dp51"}, "sbgfinfantry", 8, 35, 0, false, true, TEAM_SBGF)
TEAM_SBGFDELEGATE = AddExtraTeam("S.B.G.F Delegate", Color(255, 140, 10, 255), "models/player/guerilla.mdl", 
[[A delegate talks with the enemy to work out trades, land claims, ect.]], {"weapon_crowbar"}, "sbgfd", 3, 29, 0, false, true, TEAM_SBGF)
TEAM_SBGFSHOT = AddExtraTeam("S.B.G.F Shotgun", Color(255, 140, 0, 255), "models/player/guerilla.mdl", 
[[One of the Prime elements in Guerilla warfare. These are the Close range fighters.]], {"kermite_shot_winch1300", "kermite_pist_ot33pemac"}, "sbgfshot", 2, 40, 0, false, true, TEAM_SBGF)
TEAM_SBGFGEN = AddExtraTeam("S.B.G.F General", Color(255, 140, 0, 255), "models/player/guerilla.mdl", 
[[The General of S.B.G.F ]], {"kermite_pist_dp51"}, "sbgfgen", 1, 40, 0, false, true, TEAM_SBGF)
TEAM_SBGFRECON = AddExtraTeam("S.B.G.F Recon", Color(255, 140, 0, 255), "models/player/guerilla.mdl", 
[[Scouts the plains ahead ]], {"kermite_pist_dp51", "kermite_smg_tcusc"}, "Sbgfrecon" , 1, 40, 0, false, true, TEAM_SBGF)
TEAM_ADMIN = AddExtraTeam("<CtT> Admin", Color(160, 32, 240, 255), "models/player/combine_super_soldier.mdl", 
[[GIT SUM BITCHEEESSSSS!]], {"kermite_smg_tcusc", "weapon_real_cs_admin_weapon", "admin_keypad_cracker", "weapon_real_cs_pumpshotgun"}, "cttadmin", 29, 15000, 1, false, false)
